﻿using RpcExtend.Model;
using RpcExtend.Model.DB;
using SqlSugarHelper;

namespace RpcExtend.DAL.Repository
{
    internal class IdentityProwerDAL : IIdentityProwerDAL
    {
        private IRepository<IdentityProwerModel> _BasicDAL;
        public IdentityProwerDAL(IRepository<IdentityProwerModel> dal)
        {
            _BasicDAL = dal;
        }
        public IdentityPrower[] GetPrower(Guid appId, string systemType)
        {
            return _BasicDAL.Gets(c => c.AppId == appId && c.SystemType == systemType, c => new IdentityPrower
            {
                ResourceType = c.ResourceType,
                Value = c.Value
            });
        }
    }
}
